package productmanagementclient;

import java.net.MalformedURLException;
import java.rmi.NotBoundException;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.util.List;

import productmanagementclient.db.adapter.ProductAdapter;
import productmanagementclient.publish.Product;

public class Main {
	public static void main(String args[]) throws MalformedURLException, RemoteException, NotBoundException {
		System.setProperty("java.security.policy", "security.policy");
		if (System.getSecurityManager() == null) { 
			System.setSecurityManager(new RMISecurityManager());
		}
		
		List<Product> allProduct = ProductAdapter.getInstance().getAllProduct();
//		RmiServer server = (RmiServer)Naming.lookup("rmi://localhost/productobject");
//		List<Product> allProduct = server.getAllProduct();
		for (Product product : allProduct) {
			System.out.println(product.getName());
		}
	}
}
